// Package vehicle_brand 模型
package vehicle_brand

import (
	// "gitee.com/sweetsunnyflower/carpooling-server-go/pkg/logger"
	"gitee.com/sweetsunnyflower/carpooling-server-go/app/models"
	"gitee.com/sweetsunnyflower/carpooling-server-go/pkg/database"
)

type VehicleBrand struct {
	models.BaseModel
	Name    string `gorm:"column:name" db:"name" json:"name" form:"name"`
	Country string `gorm:"column:country" db:"country" json:"country" form:"country"`
	QueryId uint64 `gorm:"column:query_id" db:"query_id" json:"query_id" form:"query_id"`
	models.CommonTimestampsField
}

func (vehicleBrand *VehicleBrand) Create() {
	database.DB.Create(&vehicleBrand)
}

func (vehicleBrand *VehicleBrand) Save() (rowsAffected int64) {
	result := database.DB.Save(&vehicleBrand)
	return result.RowsAffected
}

func (vehicleBrand *VehicleBrand) Delete() (rowsAffected int64) {
	result := database.DB.Delete(&vehicleBrand)
	return result.RowsAffected
}
